using Machine.Specifications;
using Unbound.Tests.Unbinding.TestObjects;

namespace Unbound.Tests.Unbinding.Specifications.ComplexTypes
{
	[Subject("Unbinding")]
	public class complex_type : unbinding<ComplexType>
	{
		Establish context = () =>
		                    	{
		                    		Request = new ComplexType
		                    		          	{
		                    		          		Number = 42,
		                    		          		Text = "Something"
		                    		          	};
		                    		Prefix = "foo";
		                    	};

		Behaves_like<complex_binding_behaviors> it_was_properly_bound;

		[Behaviors]
		protected class complex_binding_behaviors : behavior<ComplexType>
		{
			It should_bind_type = () => Bound.ShouldBeOfType<ComplexType>();

			It should_bind_values = () =>
			                        	{
			                        		((ComplexType) Bound).Number.ShouldEqual(42);
			                        		((ComplexType) Bound).Text.ShouldEqual("Something");
			                        	};
		}
	}
}